﻿using System;
using System.Collections.Generic;
using System.Web.Services;
using System.Linq;
using DCS.Business.Manager;
using DCS.Business.Model;
using DCS.Business.Model.PublishUsage;

namespace DCS.DataService
{
    /// <summary>
    /// DataService 的摘要说明
    /// </summary>
    [WebService(Namespace = "http://dcs.ceair.com/")]
    [System.Web.Script.Services.ScriptService]
    public class DataPublishService : System.Web.Services.WebService
    {
        [WebMethod]
        public string HelloWorld()
        {
            return "Hello World - Just for test";
        }

        [WebMethod(Description = "获取指定航班在指定航段上所有常旅客的详细信息")]
        public List<PRLMessage> GetFQPassengers(string loginsystem, string carrier, string flightNo, string pdate, string dept, string arr)
        {
            return BOProxy.Instance.GetFQPassengers(loginsystem, carrier, flightNo, pdate, dept, arr);
        }

        [WebMethod(Description = "获得指定航班的配载平衡信息")]
        public LDMMessage GetLDMMessage(string loginsystem, string carrier, string flightNo, string pdate, string dept, string arr)
        {
            return BOProxy.Instance.GetLDMMessage(loginsystem, carrier, flightNo, pdate, dept, arr).FirstOrDefault();
        }

        [WebMethod(Description = "获取指定航班在指定航站起飞时，机上乘客汇总信息和详细信息")]
        public FlightPassengerInfo GetFlightPassengerInfo(string loginsystem, string carrier, string flightNo, string pdate, string dept, string arr)
        {
            return BOProxy.Instance.GetFlightPassengerInfo(loginsystem, carrier, flightNo, pdate, dept, arr);
        }

        [WebMethod(Description = "获取指定航班在指定航段上，机上乘客详细信息")]
        public List<PRLMessage> GetAllPassengers(string loginsystem, string carrier, string flightNo, string pdate, string dept, string arr)
        {
            return BOProxy.Instance.GetAllPassengers(loginsystem, carrier, flightNo, pdate, dept, arr);
        }

        [WebMethod(Description = "查询旅客乘机记录")]
        public List<PRLMessage> QueryTripHistory(string surname, string givenname, string foid, string cnin)
        {
            return BOProxy.Instance.QueryTripHistory(surname.ToUpper(), givenname.ToUpper(), foid, cnin);
        }
    }
}